/**
 * Created by FXY on 2017/12/7.
 */
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { environment } from '../../environments/environment';
import 'rxjs/add/operator/map';

@Injectable()
export class StepPriceService {

    stepPrices: string[];
    url: string;

    constructor(public http: Http) {
        this.stepPrices = [];
        this.url = environment.host + ":" + environment.port;
    }

    getStepPrice() {
        return this.http.get(this.url + "/stepPrice")
            .map(res => res.json());
    }

    addStepPrice(step) {
        return this.http.post(this.url + "/stepPrice/add", step)
            .map(res => res.json());
    }

    deleteStepPrice(id) {
        return this.http.get(this.url + "/stepPrice/delete/" + id)
            .map(res => res.json());
    }
}
